#include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
using namespace std;

class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int result = 0;
        for(int num : nums) {
            result ^= num;
            //cout << result << "^" << num << "=" << (result ^= num) << endl;
        }
        cout << endl;
        return result;
    }
};

int main()
{
    Solution s;
    vector<int> nums = {4,4,3,1,2,1,2};
    cout << s.singleNumber(nums) << endl;
    return 0;
}